wwine(){
	_modTitle(){
		cat <<-__EOT__
		
		========================================
		$1. $2
		========================================
		__EOT__
	}
	_modResult(){
		cat <<-__EOT__
		
		NAME              VALUE
		----------------  ------------------------------------------------------
		WINEPREFIX        ${res[0]}
		APPLICATION       ${res[1]}
		EMULATION         ${res[2]}
		----------------  ------------------------------------------------------
		
		$(echo wine "$@")
		
		__EOT__
	}
	_modListTable(){
		for (( i = 0; i < $2; i ++ )); do
			echo "$(( i + 1 )): $(eval echo $3)"
		done
		echo
		while :; do
			echo -n "番号を選択して下さい: "
			read n
			[ "$(echo $n | grep -Eo "[0-9]+")" ] && (( 0 < n && n <= i )) && break
		done
		(( n -- ))
		case "$1" in
			1	) res[0]="${arrayPre[n]}"; echo "=> "${res[0]}""; export WINEPREFIX="${res[0]}";;
			2	) res[1]="${arrayApp[n]}"; echo "=> "${res[1]}"";;
			3	) res[2]="${arrayEmu[n]}"; echo "=> "${res[2]}"";
				case $n in
					0	) unset res[2];;
					1	) res=("${res[0]}" "explorer" "/desktop=${res[2]}" "${res[1]}");;
					*	) res=("${res[0]}" "explorer" "/desktop=$(command wine --version),${res[2]}" "${res[1]}");;
				esac;;
		esac
		unset i n
	}
	_modMain(){
		_modTitle	$1 $2
		_modListTable	$1 $3 $4
	}
	_modRun(){
		_modResult "$@"
		command wine "$@"
		unset ${!array*} ${!res*}
	}
	
	. "${HOME}"/.WineStarter
	
	arrayPre=($(find ~ -maxdepth 1 -name ".wine*"))
	arrayApp=("${app[@]}")
	arrayEmu=("設定しない" "Default" "${vd[@]}")
	
	_modMain	1	"プレフィックスの選択"	"${#arrayPre[@]}"	'${arrayPre[i]}'
	_modMain	2	"アプリケーションの選択"	"${#arrayApp[@]}"	'${arrayApp[i]}'
	_modMain	3	"仮想デスクトップの選択"	"${#arrayEmu[@]}"	'${arrayEmu[i]}'
	
	_modRun "${res[@]:1}"
}
